//
//  RMMGoodsDetialsViewController.m
//  Romomo
//
//  Created by puman on 16/10/11.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMGoodsDetialsViewController.h"
#import "RMMGoodsDetailsHeadView.h"
#import "RMMShopingDetailsBottomView.h"
#import "RMMGoodsConfirmViewController.h"
#import "RMMGoodsJiaoShaoTableViewCell.h"
#import "RMMEvaluationTableViewCell.h"
#import "RMMHomeShareView.h"
#import "RMMLongingViewController.h"
#import "RMMShopingModel.h"
#import "RMMAboutMineViewController.h"

@interface RMMGoodsDetialsViewController ()<UITableViewDataSource, UITableViewDelegate, UIScrollViewDelegate>

    
@end

@implementation RMMGoodsDetialsViewController
{
    UITableView *_tableView;
    RMMGoodsDetailsHeadView *_headView;
    RMMShopingDetailsBottomView *_bottmView;
    RMMHomeShareView *_shareView;
    RMMNotNetWorkView *_networkView;
    RMMToTopView *_topView;
    UIButton *_eveBut;
    NSDictionary *_dataDic;
    NSArray *_stepArray;;
    NSArray *_eleventArray;
    UILabel *_jinDuLabel;
    CGFloat _sectionTwoHeight;
    CGFloat _sectionOneHeight;
    NSInteger _buttonTag;
    NSMutableDictionary *_rowHeightDic;
    UIButton *_moreBut;
    UIView *_footView;
    RMMShopingModel *_model;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = kWhiteColor;
    self.navigationController.navigationBar.translucent = NO;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.tabBarController.tabBar.hidden = YES;
    self.navigationItem.title = @"商品详情";
    [self addViews];
    [self getData];
    // Do any additional setup after loading the view.
}
- (void)addViews{
    _buttonTag = 10;
    _sectionOneHeight = 44;
    _sectionTwoHeight = 44;
    _rowHeightDic = [NSMutableDictionary dictionary];
    _footView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth,16)];
    _footView.backgroundColor = COLORFROMCODE(0xF5F6F7, 1);
    
    _moreBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _moreBut.frame = CGRectMake(0, 0, _footView.width, 34);
    _moreBut.backgroundColor = kWhiteColor;
    [_moreBut setTitle:@"显示更多" forState:(UIControlStateNormal)];
    [_moreBut setTitleColor:kBasicColor forState:(UIControlStateNormal)];
    _moreBut.titleLabel.font = kFont(16);
    BUTTON_S(_moreBut, moreButChick);
    _moreBut.hidden = YES;
    [_footView addSubview:_moreBut];

    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, kScreenHeight - 49 - 64) style:(UITableViewStylePlain)];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
    [_tableView registerClass:[RMMGoodsJiaoShaoTableViewCell class] forCellReuseIdentifier:@"JSCell"];
    [_tableView registerClass:[RMMEvaluationTableViewCell class] forCellReuseIdentifier:@"EvaluationCell"];

    _tableView.tableFooterView = _footView;
    [self.view addSubview:_tableView];
    
    _headView = [[RMMGoodsDetailsHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, kScreenWideth + 3 * kHalf + 1)];
    _tableView.tableHeaderView = _headView;
    _bottmView = [[RMMShopingDetailsBottomView alloc] initWithFrame:CGRectMake(0, kScreenHeight - 64 - 49, kScreenWideth, 49)];
    BUTTON_S(_bottmView.toMartBUt, toMartBUtClick);
    if ([_mySkill isEqualToString:@"1"]) {
        _bottmView.hidden = YES;
    } else {
        _bottmView.hidden = NO;
    }
    NSString *backValue = [[RMMFileManager shareHandle] getValeForKey:@"SHOPMARTCOUNT"];
    if (backValue != nil) {
        if ([backValue integerValue] > 0) {
            _bottmView.countLabel.hidden = NO;
            _bottmView.countLabel.text = backValue;
        } else {
            _bottmView.countLabel.hidden = YES;
        }
    }
    BUTTON_S(_bottmView.addChartBut, addChartBut);
    BUTTON_S(_bottmView.buyNowBut, buyNowBut);
    [self.view addSubview:_bottmView];
    [self addRightItem];
    
    for (int i = 0; i < 2; i++) {
        UIButton *button = [self.view viewWithTag:10 + i];
        if (i == 1) {
            _eveBut = button;
        }
        BUTTON_S(button, buttonClick:);
    }
    _shareView = [[RMMHomeShareView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, kScreenHeight)];
    _shareView.hidden = YES;
    UIWindow *widow = [UIApplication sharedApplication].keyWindow;
    [widow addSubview:_shareView];
    BUTTON_S(_shareView.copysBut, copyButClick);
    // 分享按钮
    for (int i = 0; i < 5; i++) {
        UIButton *button = [_shareView viewWithTag:50 + i];
        BUTTON_S(button, shareButtonClick:);
    }
    _networkView = [[RMMNotNetWorkView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, kScreenHeight - 64)];
    _networkView.hidden = YES;
    BUTTON_S(_networkView.button, networkBut);
    [self.view addSubview:_networkView];
    
    _topView = [[RMMToTopView alloc] initWithFrame:CGRectMake(kScreenWideth - 70, kScreenHeight - 200, 50, 50)];
    _topView.layer.cornerRadius = 25;
    _topView.layer.masksToBounds = YES;
    _topView.hidden = YES;
    BUTTON_S(_topView.topBut, topButCkick);
    [self.view addSubview:_topView];
    
}
- (void)topButCkick{
    [_tableView setContentOffset:CGPointMake(0, 0)];
}
- (void)networkBut{
    [self getData];
}
- (void)toMartBUtClick{
    NS_POST(@"SHOPMARTCLEAN", nil, nil);
    _bottmView.countLabel.hidden = YES;
    [[RMMFileManager shareHandle] saveVale:@"0" forKey:@"SHOPMARTCOUNT"];
    UITabBarController *VC = (UITabBarController *)keyWidow.rootViewController;
    [VC setSelectedIndex:1];
}
- (void)addRightItem{
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"share11@3x"] style:(UIBarButtonItemStylePlain) target:self action:@selector(share)];
    rightItem.tintColor = [UIColor whiteColor];
     self.navigationItem.rightBarButtonItem = rightItem;
}
- (void)getData{
    NSMutableDictionary *parDic = [NSMutableDictionary dictionary];
    parDic[@"org_no"] = Org_no;
    parDic[@"service_id"] = _service_id;
    NSString *url = HomeOneClassDataDetailsUrl;
    [OSRequestManager requestWithUrlString:url parDic:parDic network:^(BOOL isNetwork) {
        if (!isNetwork) {
            _networkView.hidden = NO;
        } else {
            _networkView.hidden = YES;
        }

    } method:(GET) finish:^(NSDictionary *dataDic) {
        NSString *status = [NSString stringWithFormat:@"%@",dataDic[@"status"]];
        if ([status isEqualToString:@"1"]) {
            _dataDic = [RMMFileManager setValueForDic:dataDic[@"data"][@"ServiceDe"]];
            _stepArray = dataDic[@"data"][@"ServiceStep"];
            _eleventArray = dataDic[@"data"][@"EvaluateDetail"][@"EvaluateList"];
            for (int i = 0; i < _eleventArray.count; i++) {
                [_rowHeightDic setObject:@"0" forKey:[NSString stringWithFormat:@"%d",i]];
            }
            _headView.dic = _dataDic;
            [_eveBut setTitle:[NSString stringWithFormat:@"评论(%ld)",_eleventArray.count] forState:(UIControlStateNormal)];
            if ([[_eveBut titleForState:(UIControlStateNormal)] isEqualToString:@"评论(0)"]) {
                _eveBut.userInteractionEnabled = NO;
            }
        } else {
            [RMMFileManager MBProgressWith:dataDic[@"message"] onView:self.view];
        }
        [_tableView reloadData];
    } error:^(NSError *errors) {
        
    } view:self.view];
}
// 商品详情和评论切换
- (void)buttonClick:(UIButton *)button{
    _buttonTag = button.tag;
    if (_buttonTag == 10) {
        _footView.frame = CGRectMake(0, 0, kScreenWideth, 16);
        _moreBut.hidden = YES;
    } else {
        _footView.frame = CGRectMake(0, 0, kScreenWideth, 50);
        _moreBut.hidden = NO;
    }
    for (int i = 0; i < 2; i++) {
        UIButton *buttons = [self.view viewWithTag:10 + i];
        buttons.backgroundColor = kWhiteColor;
        [buttons setTitleColor:COLORFROMCODE(0x000000, 1) forState:(UIControlStateNormal)];
        if (buttons.tag == _buttonTag) {
            [buttons setTitleColor:kWhiteColor forState:(UIControlStateNormal)];
            buttons.backgroundColor = kBasicColor;
            buttons.userInteractionEnabled = NO;
        } else {
            buttons.userInteractionEnabled = YES;
        }
    }
    [_tableView reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    if (_buttonTag == 10) {
        return 4;
    } else {
        return 1;
    }
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (_buttonTag == 10) {
        return 1;
    } else {
        return _eleventArray.count;
    }
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    if (_buttonTag == 10) {
        if (section == 0) {
            UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, 44)];
            view.backgroundColor = COLORFROMCODE(0xF5F6F7, 1);
            
            _jinDuLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 3 * kHalf, view.height)];
            _jinDuLabel.font = kFont(13);
            _jinDuLabel.textColor = COLORFROMCODE(0x9B9B9B, 1);
            if (_stepArray.count) {
                NSInteger count = kScreenWideth / 156;
                _jinDuLabel.text = [NSString stringWithFormat:@"项目流程%ld/%ld",count,_stepArray.count];
            } else {
                _jinDuLabel.text = @"项目流程0/0";
            }
            [view addSubview:_jinDuLabel];
            return view;
        } else if (section == 1 || section == 2) {
            UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, 44)];
            view.backgroundColor = COLORFROMCODE(0xF5F6F7, 1);
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, kScreenWideth - 30, view.height)];
            label.font = kFont(13);
            label.textColor = COLORFROMCODE(0x9B9B9B, 1);
            if (section == 1) {
                label.text = @"项目介绍";
            } else {
                label.text = @"注意事项";
            }
            [view addSubview:label];
            return view;
        } else {
            UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth,16)];
            view.backgroundColor = COLORFROMCODE(0xF5F6F7, 1);
            
            return view;
        }

    } else {
        return nil;
    }
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (_buttonTag == 10) {
        if (indexPath.section == 3) {
            return 54;
        } else if (indexPath.section == 2) {
            return _sectionTwoHeight;
        } else if (indexPath.section == 1) {
            return _sectionOneHeight;
        } else {
            return 186;
        }

    } else {
        CGFloat height = [[_rowHeightDic objectForKey:[NSString stringWithFormat:@"%ld",indexPath.row]] floatValue];
        if (height == 0) {
            height = [self checkedRowHeightWithRow:indexPath.row];
        }
        return height;
    }
}
- (CGFloat)checkedRowHeightWithRow:(NSInteger)row{
    NSDictionary *dic = [RMMFileManager setValueForDic:_eleventArray[row]];
    NSString *content = dic[@"REMARK"];
    CGFloat height = [UILabel backHeightWithString:content CGFloatCount:kScreenWideth - 30 metho:HEIGHT font:14];
    NSArray *arr = dic[@"LABLES"];
    CGFloat h = 0;
    if (arr.count) {
        if (arr.count < 5) {
            h = 25.0;
        } else {
            h = 60.0;
        }
    }
    [_rowHeightDic setObject:[NSString stringWithFormat:@"%f",28 + height + h + 8 + 10] forKey:[NSString stringWithFormat:@"%ld",row]];
    return 28 + height + h + 8 + 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (_buttonTag == 10) {
        if (section == 3) {
            return 16;
        }
        return 44;

    } else {
        return 0;
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (_buttonTag == 10) {
        if (indexPath.section == 0) {
            RMMGoodsJiaoShaoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"JSCell"];
            cell.ceeScrollView.delegate = self;
            cell.stepArray = _stepArray;
            cell.ceeScrollView.tag = 2;
            return cell;
        } else {
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            if (indexPath.section == 3) {
                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                cell.textLabel.text = @"商品购买须知";
                cell.textLabel.font = kFont(16);
                cell.textLabel.textColor = COLORFROMCODE(0x1C1D22 , 1);
            } else if (indexPath.section == 1) {
                cell.textLabel.text = [RMMFileManager retrunObjWith:_dataDic[@"IMAGE_DETAIL_DESCRIBE"]];
                cell.textLabel.font = kFont(14);
                cell.textLabel.textColor = COLORFROMCODE(0x2C2C2C , 1);
                cell.textLabel.numberOfLines = 0;
                _sectionOneHeight = [UILabel backHeightWithString:[RMMFileManager retrunObjWith:_dataDic[@"IMAGE_DETAIL_DESCRIBE"]] CGFloatCount:kScreenWideth - 30 metho:HEIGHT font:14] + kRow;
            } else if (indexPath.section == 2) {
                cell.textLabel.text = [RMMFileManager retrunObjWith:_dataDic[@"SERCER_NOTICE"]];
                cell.textLabel.font = kFont(14);
                cell.textLabel.textColor = COLORFROMCODE(0x2C2C2C , 1);
                cell.textLabel.numberOfLines = 0;
                _sectionTwoHeight = [UILabel backHeightWithString:[RMMFileManager retrunObjWith:_dataDic[@"SERCER_NOTICE"]] CGFloatCount:kScreenWideth - 30 metho:HEIGHT font:14] + kRow;
            }
            return cell;
        }

    } else {
        RMMEvaluationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"EvaluationCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.dic = [RMMFileManager setValueForDic:_eleventArray[indexPath.row]];
        return cell;
    }
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{

    if (scrollView == [self.view viewWithTag:2]) {
        NSInteger x = (scrollView.contentOffset.x + kScreenWideth) / 146;
        NSString *string = [NSString stringWithFormat:@"项目流程 %ld/%ld",x,_stepArray.count];
        if (![string isEqualToString:_jinDuLabel.text]) {
            _jinDuLabel.text = string;
        }
    } else if (scrollView == _tableView) {
        if (_tableView.contentOffset.y > 500) {
            _topView.hidden = NO;
        } else {
            _topView.hidden = YES;
        }
    }
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 3) {
        RMMAboutMineViewController *VC = [[RMMAboutMineViewController alloc] init];
        VC.titleName = @"商品购买须知";
        [self.navigationController pushViewController:VC animated:YES];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
// 立即购买
- (void)buyNowBut{
    [RMMFileManager shareHandle].fromSkillType = @"0";
    if ([RMMFileManager shareHandle].isLoginSuccess) {
        NSString *prod_type = [NSString stringWithFormat:@"%@",_dataDic[@"PROD_SERVICE_TYPE"]];
        if ([prod_type isEqualToString:@"0"]) {
            // 主项目
            RMMGoodsConfirmViewController *VC = [[RMMGoodsConfirmViewController alloc] init];
            _model = [[RMMShopingModel alloc] init];
            _model.isSelect = @"1";
            _model.COUNT = @1;
            _model.IMAGEURL = _dataDic[@"IMAGEURL"];
            _model.PRICE = _dataDic[@"PRICE"];
            _model.SERVICE_NAME = _dataDic[@"SERVICE_NAME"];
            _model.SERVICE_ID = _dataDic[@"SERVICE_ID"];
            _model.MY_CARD_ID = @"0";
            _model.TIME_LEN = _dataDic[@"TIME_LEN"];
            VC.goodsArray = [NSMutableArray arrayWithObject:_model];
            VC.isHome = [RMMFileManager shareHandle].fuWuType;
            [self.navigationController pushViewController:VC animated:YES];
        } else {
            [RMMFileManager MBProgressWith:@"辅助项目不能单独购买!" onView:self.view];
        }
    } else {
        [self addLoginAlertViewWith:@"购买商品需要先进行登录"];
    }
}
- (void)addLoginAlertViewWith:(NSString *)string{
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:string preferredStyle:(UIAlertControllerStyleAlert)];
    UIAlertAction *actionA = [UIAlertAction actionWithTitle:@"前往" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        RMMLongingViewController *loginVC = [[RMMLongingViewController alloc] init];
        [self.navigationController pushViewController:loginVC animated:YES];
        
    }];
    UIAlertAction *actionB = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    [alertController addAction:actionA];
    [alertController addAction:actionB];
    [self presentViewController:alertController animated:YES completion:nil];
}
// 计算每个评论的行高
- (void)checkedRowHeightWith:(NSArray *)array{
    for (int i = 0; i < array.count; i++) {
        NSDictionary *dic = [RMMFileManager setValueForDic:array[i]];
        NSString *content = dic[@"REMARK"];
        CGFloat height = [UILabel backHeightWithString:content CGFloatCount:kScreenWideth - 30 metho:HEIGHT font:14];
        NSArray *arr = dic[@"LABLES"];
        CGFloat h = 0;
        if (arr.count) {
            if (arr.count < 5) {
                h = 25.0;
            } else {
                h = 60.0;
            }
        }
        [_rowHeightDic setObject:[NSString stringWithFormat:@"%f",28 + height + h + 8 + 10] forKey:[NSString stringWithFormat:@"%d",i]];
    }
}
- (void)moreButChick{
    [RMMFileManager MBProgressWith:@"没有更多了" onView:self.view];
}
// 加入购物车
- (void)addChartBut{
    if (![RMMFileManager shareHandle].isLoginSuccess) {
        [self addLoginAlertViewWith:@"添加购物车,需先进行登录"];
    } else {
        NS_POST(@"ADDSHOPMARTSUCCESS", nil, nil);
        NSString *login_id = [RMMFileManager retrunObjWith:[RMMFileManager shareHandle].userDic[@"LOGIN_ID"]];
        NSString *cust_id = [RMMFileManager retrunObjWith:[RMMFileManager shareHandle].userDic[@"CUST_ID"]];
        NSMutableDictionary *parDic = [NSMutableDictionary dictionary];
        parDic[@"org_no"] = Org_no;
        if (cust_id.length) {
            parDic[@"cust_login_id"] = cust_id;
            parDic[@"loginorcust"] = @"1";
        } else {
            parDic[@"cust_login_id"] = login_id;
            parDic[@"loginorcust"] = @"0";
        }
        parDic[@"serverid"] = _service_id;
        parDic[@"sername"] = _dataDic[@"SERVICE_NAME"];
        parDic[@"count"] = @"-1";
        NSString *url = AddShopMartUrl;
        [OSRequestManager requestWithUrlString:url parDic:parDic method:GET finish:^(NSDictionary *dataDic) {
            NSString *status = [NSString stringWithFormat:@"%@",dataDic[@"status"]];
            if ([status isEqualToString:@"1"]) {
                NSString *backValue = [[RMMFileManager shareHandle] getValeForKey:@"SHOPMARTCOUNT"];
                NSInteger count = [backValue integerValue];
                count++;
                [[RMMFileManager shareHandle] saveVale:[NSString stringWithFormat:@"%ld",count] forKey:@"SHOPMARTCOUNT"];
                _bottmView.countLabel.text = [NSString stringWithFormat:@"%ld",count];
                _bottmView.countLabel.hidden = NO;
                NS_POST(@"ADDSHOPMARTSUCCESS", nil, nil);
                NS_POST(@"SHOPFRESH", nil, nil);
                [MMProgressHUD show];
                [MMProgressHUD dismissWithSuccess:@"添加成功!" title:nil afterDelay:1.0];
            } else {
                [RMMFileManager MBProgressWith:dataDic[@"message"] onView:self.view];
            }
            
        } error:^(NSError *errors) {
            
        } view:self.view];
    }
}

// 分享
- (void)share{
    _shareView.hidden = NO;
    [UIView animateWithDuration:kInterval animations:^{
        _shareView.view.frame = CGRectMake(0, kScreenHeight - 230, kScreenWideth, 230);
        _shareView.backView.alpha = 1;
    } completion:^(BOOL finished) {
    }];
}
// 复制粘贴
- (void)copyButClick{
     UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
      [pasteboard setString:@"你想粘贴的信息"];
}
- (void)shareButtonClick:(UIButton *)button{
    [UIView animateWithDuration:kInterval animations:^{
        _shareView.view.frame = CGRectMake(0, kScreenHeight, kScreenWideth, 230);
        _shareView.backView.alpha = 0.0;
    } completion:^(BOOL finished) {
        _shareView.hidden = YES;
    }];
    NSArray *array = @[@(UMSocialPlatformType_WechatSession),@(UMSocialPlatformType_WechatTimeLine),@(UMSocialPlatformType_QQ),@(UMSocialPlatformType_Sina),@(UMSocialPlatformType_Qzone)];
    
    UMSocialPlatformType platformType = - 8;
    platformType = [array[button.tag - 50] integerValue];
    UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
    if (button.tag == 53) {
       // UMShareImageObject *shareObject = [[UMShareImageObject alloc] init];
       // shareObject.thumbImage = [UIImage imageNamed:@"Icon-iPhone-60@2x"];
        messageObject.text = [NSString stringWithFormat:@"容么么https://www.baidu.com"];
       // messageObject.shareObject = shareObject;
    } else {
        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:@"容么么" descr:@"容么么周末大减价买一送10" thumImage:[UIImage imageNamed:@"Icon-iPhone-60@3x"]];
        //设置网页地址
        shareObject.webpageUrl = [NSString stringWithFormat:@"http://ydywx.puman.cn/Web/Goods_Content.aspx?SerId=%@&Flg=1",_service_id];
        messageObject.shareObject = shareObject;
    }
    [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:nil completion:^(id result, NSError *error) {
        
    }];

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
